﻿using System;

namespace Wise.TimeWarrior.Helpers
{
    /// <summary>
    /// Date Time Helper
    /// </summary>
    public static class DateTimeHelper
    {
        /// <summary>
        /// Method rounds datetime time value to 0:0:0
        /// </summary>
        /// <param name="toLower">date time to lower</param>
        /// <returns>lowered datetime</returns>
        public static  DateTime LowerToDayStart(DateTime toLower)
        {
            return new DateTime(toLower.Year, toLower.Month, toLower.Day, 0, 0, 0);
        }

        /// <summary>
        /// Method rounds datetime time value to 23:59:59
        /// </summary>
        /// <param name="toUpper">date time to upper</param>
        /// <returns>upper datetime</returns>
        public static DateTime UpperToDayEnd(DateTime toUpper)
        {
            return new DateTime(toUpper.Year, toUpper.Month, toUpper.Day, 23, 59, 59);
        }
    }
}
